import request from '@/utils/request'

// 计量设施基础信息变更申报-列表
const declareList = function (params = {}) {
  return request({
    url: `/zy-api/api/declare/findList`,
    method: 'post',
    data: params,
  })
}

// 计量设施基础信息变更申报-新增
const addDeclare = function (params = {}) {
  return request({
    url: `/zy-api/api/declare/add`,
    method: 'post',
    data: params,
  })
}

// 计量设施基础信息变更申报-修改
const editDeclare = function (params = {}) {
  return request({
    url: `/zy-api/api/declare/update`,
    method: 'post',
    data: params,
  })
}

// 计量设施基础信息变更申报-审核
const auditDeclare = function (params = {}) {
  return request({
    url: `/zy-api/api/declare/review`,
    method: 'post',
    data: params,
  })
}

// 计量设施基础信息变更申报-删除
const delDeclare = function (params = {}) {
  return request({
    url: `/zy-api/api/declare/delete`,
    method: 'post',
    data: params
  })
}

// 计量设施基础信息变更申报-删除
const declareHistory = function (facilityId, declareId) {
  let url = `/zy-api/api/declare/getHis/${facilityId}`;
  if (declareId) {
    url = `/zy-api/api/declare/getHis/${facilityId}/${declareId}`
  }
  return request({
    url,
    method: 'post',
  })
}




export {
  declareList,
  addDeclare,
  editDeclare,
  auditDeclare,
  delDeclare,
  declareHistory
}